﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;

using AutomationAdmin.ViewModels;

namespace AutomationAdmin.Views
{
    public partial class RequestNewPage : Page
    {
        public RequestNewPage()
        {
            InitializeComponent();
            this.DataContext = new List<NewAppRequest>();
            _dataForm.AddNewItem();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void _dataForm_AutoGeneratingField(object sender, DataFormAutoGeneratingFieldEventArgs e)
        {
            if (e.PropertyName == "Status" ||
                e.PropertyName == "Updates" ||
                e.PropertyName == "LastUpdate")
                e.Field.Visibility = Visibility.Collapsed;
                
        }

        private void Sumbit_Click(object sender, RoutedEventArgs e)
        {
            _dataForm.CommitEdit();
        }

    }
}
